﻿using MuddyBoots.Greenlight.QC.Common.Patterns.Behaviour.Mediator;
using System.Linq;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Input;

namespace MediatorSample
{
    /// <summary>
    /// Interaction logic for TextEntry.
    /// </summary>
    public partial class TextEntryView : UserControl
    {
        public TextEntryView()
        {
            this.InitializeComponent();
        }

        private void OnTextChanged(object sender, TextChangedEventArgs e)
        {
            var textBox = sender as TextBox;
            if (textBox != null)
            {
                Mediator.NotifyColleagues("TextChanged", textBox.Text);
            }
        }
    }
}
